package rise.net;

import rise.comunity.Community;
import rise.comunity.UserData;
import rise.message.Logout;
import rise.message.Packet;
import rise.ui.AccessActivity;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.Log;

public class LogoutTask extends SenderTask {
	private Activity activity;

	public LogoutTask(Activity activity, Logout logout, Context context) {
		super(logout, context);
		this.activity = activity;
	}

	@Override
	protected void onPostExecute(Integer result) {
		if (result == Packet.CONNECTION_ERROR
				|| result == Packet.UNKNOWN_PACKET) {
			super.onPostExecute(result);
			return;
		}

		if (result == Packet.OK) {
			this.handleLoggedOut();
			return;
		}
	}

	void handleLoggedOut() {
		super.exitFromApplication();
	}


}
